<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <h1>{{ question.question_text }}</h1>

    {% if error_message %}<p><strong>{{ error_message }}</strong>{% endif %}

    <form action="{% url 'polls:vote' question_id %}" method="post">
        {% csrf_token %}
        {% for choice in question.choice_set.all %}
            <input type="radio" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}">
            <label for="choice{{ forloop.counter }}"> {{ choice.choice_text }}</label><br>
            {#  forloop.counter 指示 for 标签已经循环多少次。 #}
        {% endfor %}
    <input type="submit" value="Vote">
    </form>

</body>
</html>